package com.javalong.affairs.module.renwujinzhang.activity.audit.fragment;

import android.view.View;
import android.widget.AdapterView;

import com.javalong.affairs.R;
import com.javalong.affairs.base.activity.ToolbarActivity;
import com.javalong.affairs.base.constant.DataType;
import com.javalong.affairs.base.constant.MapKey;
import com.javalong.affairs.module.renwujinzhang.activity.audit.WatchFinishAuditTaskActivity;
import com.javalong.affairs.module.renwujinzhang.model.Task;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by 杨观回 on 2016/2/28 0028.
 */
public class FinishAuditFragment extends AuditFragment {

    @Override
    protected int getDataId() {
        return R.string.data_tracktask_audit_finish;
    }

    @Override
    protected Map<String, Object> getMapData() {
        Map<String, Object> param = new HashMap<>();
        param.put(MapKey.ACTION_NAME, "Task");
        param.put(MapKey.METHOD_NAME, "outList_auditList_audit");
        param.put(MapKey.DATA_RESID, R.string.data_tracktask_audit_finish);
        param.put(MapKey.DATA_TYPE, DataType.LIST_TRACKTASK);
        return param;
    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        Task task = getTask(position - 2);
        if (task != null) {
            WatchFinishAuditTaskActivity.toThisActivity(getActivity(), task);
        }
    }


    @Override
    protected void afterInit() {
        ((ToolbarActivity) getActivity()).getSupportActionBar().setTitle("已审核列表");
    }
}
